/*
 * @Author: cjj
 * @Date: 2024-11-19 09:17:12
 * @LastEditors: cjj
 * @LastEditTime: 2024-11-19 10:15:26
 * @Description: 2901545842@qq.com
 */
import { ref } from 'vue'
import { defineStore } from 'pinia'
export const exchangeStore = defineStore('exchange',()=>{
        
      

        //定义兑换记录
        const meters = ref(JSON.parse(localStorage.getItem('meters') || '[]'))
        
        //方法：
        function addExchangeRecord(record){
            meters.value.push(record)
            localStorage.setItem('meters',JSON.stringify(meters.value))
        }
        return {
            meters,
            addExchangeRecord
        }
})
